<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "/admin/include/head.htm">
<script type="text/javascript">
	var paymentBundleId = "${(paymentBundleId)!''}";
	var grid;
	$(function(){
		 grid = $("#maingrid").ligerGrid({
            columns: [
			{name: 'id', hide: true, width:0, isAllowHide: false},
			{display: '名称', name: 'name', align: 'center', width: 200 },
			{display: '类型', name: 'payType', i18n:'payType', align: 'center', width: 100 },
			{display: '介绍', name: 'description', align: 'left', minWidth: 500}], 
			pageSize:20, url: '${base}/admin/system/paymentType/queryData.jhtml',
			toolbar: {}, width: '100%', height:'100%'
        });
        $("#pageloading").hide();
		LG.loadToolbar(grid);
		
		//绑定搜索按钮
		LG.search(grid);
	});
	
	function add(){
		top.f_addTab(null, '新增支付方式', base + '/admin/system/paymentType/add.jhtml');
	}
	
	function edit(){
		var selected = grid.getSelected();
    	if (!selected) { 
    		LG.tip('请选择行!'); 
    		return; 
    	}
    	var id = selected.id;
		if (top.f_isTabItemExist("paymentType" + id)) {
			top.f_switchTab("paymentType" + id);
		}else {
			top.f_addTab("paymentType" + id, '修改支付方式[' + selected.name + ']', base + '/admin/system/paymentType/edit.jhtml?id='+id);
		}
	}
	function f_delete() {
		var selecteds = grid.getSelecteds();
		if (selecteds.length > 0) {
			jQuery.ligerDialog.confirm('确定删除吗?', function (confirm) {
	      		if (confirm){
	      			LG.ajax({
	      				url: base + '/admin/system/paymentType/delete.jhtml',
	      				loading: '正在删除中...',
		              	data: { ids: LG.getIds(selecteds) },
		              	success: function () {
		                  	LG.showSuccess('删除成功');
		                  	f_reload();
		              	},
		              	error: function (message) {
		                  	LG.showError(message);
		              	}
		          	});
		        }
		    });
	      } else {
	          LG.tip('请选择行!');
	      }
	  }
</script>
</head>
<body>
	<div id="maingrid" style="margin:0; padding:0"></div>
</body>
</html>